{{template "main"}}
<title>博客登录</title>
</head>
    <body>
{{template "head" .}}
<div class="bs-docs-header">
	<div class="container">
		<label class="col-sm-2">用户登录</label>
	</div>
</div>
<div class="container">
	<div class="page-header">
		<div class="bs-example" >
			<form class="form-horizontal" method="POST" action="/login">
				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-10">
						<div class="input-group">
						<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
						<input type="text" id="uname" class="form-control" placeholder="username" name="username" style="width:85%">
						</div>
					</div>
				</div>
				
				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-10">
					<div class="input-group">
						<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
						<input type="password" id="pwd" class="form-control" placeholder="Password" name="password" style="width:85%">
					</div>
					</div>
				</div>
				
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						<div class="checkbox">
							<label><input type="checkbox" name="autologin">自动登录</label>
						</div>
					</div>
				</div>
				<div class="form-group">
					{{if .loginerror}}
						<label class="col-sm-2 control-label" style="color:red">登录失败!</label>
					{{end}}
					<div class="col-sm-offset-2 col-sm-10">
						<button type="submit" class="btn btn-success form-control" onclick="return checkinput();" style="width:85%">登录</button>
					</div>
						<script type="text/javascript">
							function checkinput(){
								var uname=document.getElementById("uname");
								var pwd=document.getElementById("pwd");
								if (uname.value.length==0){
									alert('用户名不能为空');
									return false
								};
								if (pwd.value.length==0){
									alert('密码不能为空');
									return false
								};
								return true
								
								}
						</script>

				</div>
			</form>
		</div>
	</div>
</div>
{{template "endhtml"}}